import request from '@/utils/request'

// 查询产品软件发布列表
export function listProductSoftwareRelease(query) {
  return request({
    url: '/produce/product-software-release/list',
    method: 'get',
    params: query
  })
}

// 查询产品软件发布详细
export function getProductSoftwareRelease(id) {
  return request({
    url: '/produce/product-software-release/' + id,
    method: 'get'
  })
}

// 新增产品软件发布
export function addProductSoftwareRelease(data) {
  return request({
    url: '/produce/product-software-release',
    method: 'post',
    data: data
  })
}

// 修改产品软件发布
export function updateProductSoftwareRelease(data) {
  return request({
    url: '/produce/product-software-release',
    method: 'put',
    data: data
  })
}

// 删除产品软件发布
export function delProductSoftwareRelease(id) {
  return request({
    url: '/produce/product-software-release/' + id,
    method: 'delete'
  })
}

// 逻辑删除产品软件发布
export function removedProductSoftwareRelease(id) {
  return request({
    url: '/produce/product-software-release/' + id,
    method: 'delete'
  })
}

// 任务状态修改
export function changeStatus(id, status) {
    return request({
      url: '/produce/product-software-release/change-status',
      method: 'put',
      params:{
        id,status
      },
    })
}

// 打包
export function packing(id) {
  return request({
    url: '/produce/product-software-release/packing/' + id,
    method: 'get'
  })
}

// 发布
export function pub(id,releaseStatus) {
  return request({
    url: '/produce/product-software-release/change-release-status',
    method: 'put',
    params:{
      id,releaseStatus
    }
  })
}
